package com.dk.service.impl;

import com.dk.mapper.UUserMapper;
import com.dk.pojo.UUser;
import com.dk.pojo.UUserExample;
import com.dk.service.LogenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogenServiceImpl implements LogenService {

    @Autowired
    private UUserMapper uUserMapper;

    @Override
    public UUser listGet(String uname) {

        UUserExample example = new UUserExample();
        UUserExample.Criteria criteria = example.createCriteria();
        criteria.andUnameEqualTo(uname);
        List<UUser> list = uUserMapper.selectByExample(example);
        return (list == null || list.size() <= 0) ? null : list.get(0);
    }
}
